ABC140 B - Buffet
https://atcoder.jp/contests/abc140/tasks/abc140_b
提出
code: python
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
before = -1
ans = 0
for i in a:
ans += b
i-1
if (i == before + 1):
ans += c
i-2
before = i
print(ans)